<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			#wrap{
				width: 300px;
				height: 300px;
				border: 1px solid;
				display: flex;
				flex-direction: row;
				flex-wrap: wrap-reverse;
				align-content: stretch;
			}
			.item{
				width: 50px;
				/*height: 50px;*/
				background: pink;
				text-align: center;
			}
		</style>
	</head>
	<body>
		<div id="wrap">
			<div class="item">1</div>
			<div class="item">2</div>
			<div class="item">3</div>
			<div class="item">4</div>
			<div class="item">5</div>
			<div class="item">6</div>
			<div class="item">8</div>
			<div class="item">9</div>
			<div class="item">10</div>
			<div class="item">11</div>
			<div class="item">12</div>
			<div class="item">13</div>
			<div class="item">14</div>
		</div>
	</body>
</html>
